SELECT ORG_UNIT."NAME",CASE WHEN PAR.CODE = 'group' THEN NULL ELSE PAR."ID" END fid,
ORG_UNIT."ID" oaId,'n' delMark,ORG_UNIT.SORT_ID  FROM ORG_UNIT 
LEFT JOIN ORG_UNIT par ON par."PATH" = "SUBSTR"(ORG_UNIT."PATH", 0, "LENGTH"(ORG_UNIT."PATH")-4)
WHERE ORG_UNIT.IS_ENABLE = 1 AND ORG_UNIT.IS_DELETED = 0 AND PAR.IS_DELETED = 0 AND PAR.IS_ENABLE = 1
ORDER BY ORG_UNIT."PATH"